package com.xk857.school.controller;


import com.xk857.school.service.ICardDetailService;
import com.xk857.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author CV大魔王
 * @since 2021-05-03
 */
@Api(value = "校园卡已找到管理接口", tags = "校园卡已找到管理接口")
@RestController
@RequestMapping("/pri/card/detail")
public class CardDetailController {

    @Autowired
    private ICardDetailService cardDetailService;


    @ApiOperation("根据用户id查询")
    @GetMapping("/user/{userId}")
    public Result getCardByUserId(@PathVariable String userId){
        return cardDetailService.searchByUserId(userId);
    }


    @ApiOperation("修改条目状态为已阅读")
    @PutMapping("/{id}")
    public Result userHasRead(@PathVariable String id){
        return  cardDetailService.userHasRead(id);
    }
}
